import { BasicColumn, FormSchema } from '@/components/Table';
import { h, ref } from 'vue';
import { Tag } from 'ant-design-vue';
import {VxeFormItemProps, VxeGridPropTypes} from "@/components/VxeTable";
import util from "@/utils/util";


//表格列名
export const columns: BasicColumn[] = [
  {
    title: '用户名',
    dataIndex: 'userName',
    width: 130,

  },
  {
    title: '试卷名称',
    dataIndex: 'paperName',
  },
  {
    title: '得分',
    dataIndex: 'score',
    width: 130,
  },
  {
    title: '创建时间',
    width: 160,
    dataIndex: 'createTime',
  },
  {
    title: '交卷时间',
    width: 160,
    dataIndex: 'endTime',
  },

];


/**
 */
export const vxeTableColumns: VxeGridPropTypes.Columns = [
  {
    title: '部门名称',
    field: 'deptName',
    showOverflow: 'title',
    width: 120,
    align: 'center',
  },
  {
    title: '默认网关',
    field: 'defaultGateway',
    showOverflow: 'title',
    // width: 130,
    align: 'center',
  },
  {
    title: '低电量报警阈值',
    field: 'lowBattery',
    align: 'center',
    width: 80,
  },
  {
    title: '备注',
    field: 'remark',
    align: 'center',
    width: 90,
  },

  {
    title: '创建时间',
    field: 'createTime',
    width: 130,
    align: 'center',
  },

  // {
  //   width: 120,
  //   title: '操作',
  //   align: 'center',
  //   field: '',
  //   slots: { default: 'action' },
  //   fixed: 'right',
  // },
];


export const searchFormSchema: FormSchema[] = [
  {
    field: 'deptName',
    label: '部门名称',
    component: 'Input',
    colProps: { span: 8 },
  },


];


export const vxeTableFormSchema: VxeFormItemProps[] = [
  {
    span: 5,
    field: 'deptName',
    title: '搜索',
    itemRender: {
      props: {
        placeholder: '部门',
      },
      name: 'AInput',
    },
  },

  {
    span: 5,
    itemRender: {
      name: 'VxeButtonGroup',
      options: [
        { type: 'reset', content: '重置' },
        { type: 'submit', content: '查询', status: 'primary' },
      ],
    },
  },
];


export const formSchema: FormSchema[] = [

  {
    field: 'deptName',
    label: '部门',
    component:"Input",
    required: true,
  },
  {
    field: 'defaultGateway',
    label: '默认网关mac',
    component:"Input",
    required: false,
  },

  {
    field: 'lowBattery',
    label: '低电量报警阈值',
    component:"InputNumber",
    required: false,
  },
  {
    field: 'remark',
    label: '备注',
    component:"Input",
    required: false,
  },


];



